/**
 * Project:   dtu.fmes.googleloon
 * File:      Balloon.java
 * License: 
 *            This file is licensed under GNU General Public License version 3
 *            http://www.gnu.org/licenses/gpl-3.0.txt
 *
 * Copyright:	Bartosz Cichecki [ cichecki.bartosz@gmail.com ]
 * 				Nicolai Sonne [ NicolaiSonne@hotmail.com.com ]
 * Date:      Dec 11, 2013
 */

package dtu.fmes.loon.model;

import dtu.fmes.loon.model.balloon.AirPumpModule;
import dtu.fmes.loon.model.balloon.BatteryModule;
import dtu.fmes.loon.model.balloon.CommunicationModule;
import dtu.fmes.loon.model.balloon.GpsModule;
import dtu.fmes.loon.model.balloon.SolarPanelModule;

/**
 * 
 * @author Nicolai Sonne
 */
public class ConstantBalloonValues {

	private GpsModule gps = null;

	private BatteryModule battery = null;

	private SolarPanelModule solarPanel = null;

	private AirPumpModule airPump = null;

	private CommunicationModule communication = null;

	public ConstantBalloonValues() {

	}

	public ConstantBalloonValues(GpsModule gps, BatteryModule battery, SolarPanelModule solarPanel, AirPumpModule airPump,
	        CommunicationModule communication) {
		super();
		this.gps = gps;
		this.battery = battery;
		this.solarPanel = solarPanel;
		this.airPump = airPump;
		this.communication = communication;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		ConstantBalloonValues other = (ConstantBalloonValues) obj;
		if (airPump == null) {
			if (other.airPump != null) {
				return false;
			}
		} else if (!airPump.equals(other.airPump)) {
			return false;
		}
		if (battery == null) {
			if (other.battery != null) {
				return false;
			}
		} else if (!battery.equals(other.battery)) {
			return false;
		}
		if (communication == null) {
			if (other.communication != null) {
				return false;
			}
		} else if (!communication.equals(other.communication)) {
			return false;
		}
		if (gps == null) {
			if (other.gps != null) {
				return false;
			}
		} else if (!gps.equals(other.gps)) {
			return false;
		}
		if (solarPanel == null) {
			if (other.solarPanel != null) {
				return false;
			}
		} else if (!solarPanel.equals(other.solarPanel)) {
			return false;
		}
		return true;
	}

	public AirPumpModule getAirPump() {
		return airPump;
	}

	public BatteryModule getBattery() {
		return battery;
	}

	public CommunicationModule getCommunication() {
		return communication;
	}

	public GpsModule getGps() {
		return gps;
	}

	public SolarPanelModule getSolarPanel() {
		return solarPanel;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (airPump == null ? 0 : airPump.hashCode());
		result = prime * result + (battery == null ? 0 : battery.hashCode());
		result = prime * result + (communication == null ? 0 : communication.hashCode());
		result = prime * result + (gps == null ? 0 : gps.hashCode());
		result = prime * result + (solarPanel == null ? 0 : solarPanel.hashCode());
		return result;
	}

	public void setAirPump(AirPumpModule airPump) {
		this.airPump = airPump;
	}

	public void setBattery(BatteryModule battery) {
		this.battery = battery;
	}

	public void setCommunication(CommunicationModule communication) {
		this.communication = communication;
	}

	public void setGps(GpsModule gps) {
		this.gps = gps;
	}

	public void setSolarPanel(SolarPanelModule solarPanel) {
		this.solarPanel = solarPanel;
	}

	@Override
	public String toString() {
		return "ConstantBalloonValues [gps=" + gps + ", battery=" + battery + ", solarPanel=" + solarPanel + ", airPump=" + airPump
		        + ", communication=" + communication + "]";
	}

}
